<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>侧栏</title>
    <script src="/js/jquery-3.3.1/jquery-3.3.1.min.js"></script>
    <link type="text/css" rel="stylesheet" href="/css/style.css">
    <script language="javascript" type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>


</head>
<body>

<table border="0" width="225" height="100%" cellspacing="0" cellpadding="0">
    <tr height="30"><td style="text-indent:5" valign="bottom"><font color="#004790"><b>■日历</b></font></td></tr>
    <tr height="1"><td></td></tr>
    <!-- 日历 -->
    <tr height="180">
        <td valign="top"  align="center">
            <div id="div1" style="width:210px"></div>
        </td>
    </tr>

    <tr height="1"><td></td></tr>
    <tr height="30"><td style="text-indent:5" valign="bottom"><font color="#004790"><b>■信息快速搜索</b></font></td></tr>
    <tr height="1"><td></td></tr>
    <tr height="103">
        <td align="center" valign="top" background="/images/leftS.jpg">
            <table border="0" width="99%" height="100%" cellspacing="0" style="font-size:13px">
                <form id="info_SearchShow_action" name="info_SearchShow_action" action="/web/info_SearchShow.action" method="post">
                    <tr height="10"><td colspan="3"></td></tr>
                    <tr>
                        <td align="right" width="70">关键字：</td>
                        <td colspan="2" width="200"><input type="text" name="searchInfo.sqlvalue" size="12" value="" id="info_SearchShow_action_searchInfo_sqlvalue"/></td>
                    </tr>
                    <tr>
                        <td align="right">条&nbsp;&nbsp;件：</td>
                        <td colspan="2">
                            <select name="searchInfo.subsql" id="info_SearchShow_action_searchInfo_subsql" >
                                <option value=""></option>
                                <option value="infoContent">信息内容</option>
                                <option value="infoPhone">联系电话</option>
                                <option value="infoEmail">E-mail地址</option>
                                <option value="id">ID值</option>
                                <option value="infoTitle">信息标题</option>
                                <option value="infoLinkman">联系人</option>
                            </select>

                        </td>

                    </tr>
                    <tr>
                        <td align="right">搜索类型：</td>
                        <td width="80px">
                            <input type="radio" name="searchInfo.type" id="info_SearchShow_action_searchInfo_typeall" value="all"/>
                            <label for="info_SearchShow_action_searchInfo_typeall">全字匹配</label>
                            <br>
                            <input type="radio" name="searchInfo.type" id="info_SearchShow_action_searchInfo_typelike" checked="checked" value="like"/>
                            <label for="info_SearchShow_action_searchInfo_typelike">模糊搜索</label>

                        </td>
                        <td align="center" >
                            <input type="button" onclick="searchInfoPage()" id="info_SearchShow_action_0" value="搜索"/>
                        </td>
                    </tr>
                    <tr height="10"><td colspan="3"></td></tr>
                </form>
            </table>
        </td>
    </tr>
    <tr><td></td></tr>
</table>

</body>
<script>

    //  跳转至结果页面并将当前的选择数据保存
    function searchInfoPage() {
        var searchType = $('input:radio:checked').val();
        var type = $("#info_SearchShow_action_searchInfo_subsql").val();
        var key = document.getElementById("info_SearchShow_action_searchInfo_sqlvalue").value;
        if (key == null || key == '') {
            alert("请输入查询的关键字！");
        }else if (type == null || type == '') {
            alert("请选择查询的类型！");
        } else {
            window.localStorage.setItem("key", key);
            window.localStorage.setItem("type", type);
            window.localStorage.setItem("searchType", searchType);
            window.parent.location.href='/pages/show/searchshow.html';
            /*$.ajax({
                url:'/info/search',
                type:'post',
                data:{
                    type:type,
                    key:key,
                    searchType:searchType
                },
                success:function (result) {
                    console.log(result);
                }
            });*/
        }
    }

    // 参数回填
    function optionBreak() {
        console.log(window.localStorage.getItem("key"));
        $("#info_SearchShow_action_searchInfo_sqlvalue").val(window.localStorage.getItem("key"));
        $("#info_SearchShow_action_searchInfo_subsql").val(window.localStorage.getItem("type"));
        // 查询类型不作参数回填，以免不能正常取值
        // $('input:radio:checked').val(window.localStorage.getItem("searchType"));
    }

    WdatePicker({eCont:'div1'})
</script>
</html>